<%@ tag pageEncoding="UTF-8"%>
<%@ attribute name="page" required="true" type="cn.org.rapid_framework.page.Page" description="Page.java" %>
<%@ attribute name="pageSizeSelectList" type="java.lang.Number[]" required="false"  %>
<%@ attribute name="isShowPageSizeList" type="java.lang.Boolean" required="false"  %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%
	// set default values
	Integer[] defaultPageSizes = new Integer[]{10,50,100};
	if(jspContext.getAttribute("pageSizeSelectList") == null) {
		jspContext.setAttribute("pageSizeSelectList",defaultPageSizes); 
	}
	
	if(jspContext.getAttribute("isShowPageSizeList") == null) {
		jspContext.setAttribute("isShowPageSizeList",true); 
	} 
%>
			<div  class="leftControls" >
				<jsp:doBody/>
			</div>
			<div class="pager">
				<c:choose>
					<c:when test="${page.totalCount==0}">
					<div id="noResult">
						抱歉，在所有类别里没有找到相关的信息 
						</div>
					</c:when>
					<c:otherwise>
						<c:choose>
						<c:when test="${page.firstPage}"></c:when>
						<c:otherwise><a href="${url}&pageNumber=1&pageSize=${page.pageSize}">首页</a>&nbsp;</c:otherwise>
						</c:choose>
						<c:choose>
						<c:when test="${page.hasPreviousPage}"><a href="${url}&pageNumber=${page.previousPageNumber}&pageSize=${page.pageSize}">上一页</a>&nbsp;
						</c:when>
						<c:otherwise></c:otherwise>
						</c:choose>
						<c:forEach var="item" items="${page.linkPageNumbers}">
						<c:choose>
						<c:when test="${item == page.thisPageNumber}"><strong >${item}</strong>&nbsp;</c:when>
						<c:otherwise><a href="${url}&pageNumber=${item}&pageSize=${page.pageSize}">${item}</a>&nbsp;</c:otherwise>
						</c:choose>
						</c:forEach>
						<c:choose>
						<c:when test="${page.hasNextPage}">
							<a href="${url}&pageNumber=${page.nextPageNumber}&pageSize=${page.pageSize}">
								下一页</a>&nbsp;
						</c:when>
						<c:otherwise>
						</c:otherwise>
						</c:choose>
						<c:choose>
						<c:when test="${page.lastPage}">
						</c:when>
						<c:otherwise>
						<a href="${url}&pageNumber=${page.lastPageNumber}&pageSize=${page.pageSize}">
							尾页</a>&nbsp;
						</c:otherwise>
						</c:choose>
						<c:if test="${isShowPageSizeList}">
						<select onChange="simpleTable.togglePageSize(this.value)">
							<c:forEach var="item" items="${pageSizeSelectList}">
								<option value="${item}" ${page.pageSize == item ? 'selected' : '' }>${item}</option>
							</c:forEach> 
						</select>
						</c:if>
					</c:otherwise>
				</c:choose>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
